package Liczby;

public class Liczby {
	private static final String pattern = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	
	
	
	public static String convTo(int n, int base)
	{
		String result = "";
		
		if ((base > 16) || (base < 2))
			return null;
	 
		if (n == 0)
			return "0";
	 
		while (n>0)
		{
			result = pattern.charAt(n % base) + result;
			n /= base;
		}
	 
		return result;
	}
}
